package leetcode_61_80;


import org.junit.Test;
import utils.ListNode;

import java.util.Arrays;

public class Test4 {
    @Test
    // 旋转链表
    public void test61(){
        ListNode listNode1=new ListNode(1);
        ListNode listNode2=new ListNode(2);
        ListNode listNode3=new ListNode(3);
        ListNode listNode4=new ListNode(4);
        ListNode listNode5=new ListNode(5);
        listNode1.next=listNode2;
        listNode2.next=listNode3;
        listNode3.next=listNode4;
        listNode4.next=listNode5;
        new rotateRight_61().rotateRight2(listNode1,2);
    }

    @Test
    //不同路径
    public void test62(){
        System.out.println(new uniquePaths_62().uniquePaths2(3,7));
    }

    @Test
    //不同路径2
    public void test63(){
        //int [][]a={{0,0,0},{0,1,0},{0,0,0}};
        int [][]a={{0,0},{0,1}};
        System.out.println(new uniquePathsWithObstacles_63().uniquePathsWithObstacles(a));
    }

    @Test
    //最小路径和
    public void test64(){
        int [][]a={{1,3,1},{1,5,1},{4,2,1}};
        System.out.println(new minPathSum_64().minPathSum(a));
    }

    @Test
    //有效数字
    public void test65(){
        String s = ".e1";
        System.out.println(new isNumber_65().isNumber(s));
    }

    @Test
    //加一
    public void test66(){
        int []a={1,3,1};
        System.out.println(Arrays.toString(new plusOne_66().plusOne2(a)));
    }

    @Test
    //加一
    public void test67(){
        System.out.println(new addBinary_67().addBinary("1010","1011"));
    }

    @Test
    //文本左右对齐
    public void test68(){
        String[]s={"My","momma","always","said,","\"Life","was","like","a","box","of","chocolates.","You","never","know","what","you're","gonna","get."};
        System.out.println(new fullJustify_68().fullJustify(s,20));
    }

    @Test
    //x 的平方根
    public void test69(){
        System.out.println(new mySqrt_69().mySqrt(2));
    }

    @Test
    //爬楼梯
    public void test70(){
        System.out.println(new climbStairs_70().climbStairs2(4));
    }

    @Test
    //简化路径
    public void test71(){
        System.out.println(new simplifyPath_71().simplifyPath("/home/of/foo/../../bar/../../is/./here/."));
    }

    @Test
    //编辑距离
    public void test72(){
        System.out.println(new minDistance_72().minDistance("horse",  "ros"));
    }

    @Test
    //矩阵置零
    public void test73(){
        int [][]a={{1,3,1},{1,0,1},{4,2,1}};
        new setZeroes_73().setZeroes(a);
    }

    @Test
    //搜索二维矩阵
    public void test74(){
        int [][]a={{1,2,4},{6,8,10},{14,20,25}};
        System.out.println(new searchMatrix_74().searchMatrix(a,7));
    }

    @Test
    //颜色分类
    public void test75(){
        int []a={2,0,2,1,1,0};
        new sortColors_75().sortColors(a);
    }

    @Test
    //最小覆盖子串
    public void test76(){
        System.out.println(new minWindow_76().minWindow("ADOBECODEBANC", "ABC"));
    }

    @Test
    //组合
    public void test77(){
        System.out.println(new combine_77().combine2(4,2));
    }

    @Test
    //子集
    public void test78(){
        int []a={1,2,3};
        System.out.println(new subsets_78().subsets(a));
    }

    @Test
    //单词搜索
    public void test79(){
        char[][]board = {{'A','B','C','E'},{'S','F','C','S'},{'A','D','E','E'}};
        String word = "ABCCED";
        System.out.println(new exist_79().exist(board,word));
    }

    @Test
    //删除有序数组中的重复项 II
    public void test80(){
        int []a={1,1,1,1,1,1,2,2,2,2,2,2,3};
        System.out.println(new removeDuplicates_80().removeDuplicates2(a));
    }
}

